package ai.gui;

import java.awt.Color;
import java.awt.Graphics;
import java.util.ArrayList;
import java.util.Collection;

import javax.swing.BorderFactory;
import javax.swing.JPanel;

public class DrawArea extends JPanel{
		
	private static final long serialVersionUID = 1L;
	private Collection<Drawable> drawables;

	public DrawArea(){
		setBorder(BorderFactory.createLineBorder(Color.black));
		this.drawables = new ArrayList<Drawable>();
	}
	
	@Override
	public void paint(Graphics g){
		super.paint(g);
		for (Drawable drawable: this.drawables){
			drawable.draw(g);
		}
	}
	
	public Collection<Drawable> getDrawables() {
		return drawables;
	}

	public void setDrawables(Collection<Drawable> drawables) {
		this.drawables = drawables;
	}
}

